/**
 * 
 */
package nunesanderson;

import java.util.Random;

/**
 * @author anderson
 *
 */
public class CMain {

	/**
	 * @param args
	 */
	public static void main(String[] args) {		
		for(int i = 0; i <= 10; i++){
			System.out.print(fib(i) + " ");
		}
		
		int[] vet = new int[99999];
		Random rand = new Random();
		for(int i = 0; i < vet.length;i++){
			vet[i] = (rand.nextInt(9999)*1);
		}
		int[] t = ordenarVetor(vet); 
		for(int i = 0; i < t.length;i++){
			System.out.print(t[i] + "-");
		}
		
		
	}
	
	/**
	 * Metodo que retorna o n-esimo numero de fibinacci
	 * @param i
	 * @return
	 */
	public static int fib(int i){
		if(i == 0){
			return 0;			
		}else if(i == 1){
			return 1;			
		}else{
			int b = fib(i-1) + fib(i-2);			
			return b; 
		}			
	}
	
	public static int[] ordenarVetor(int[] vetor){		
		int aux;
		for(int i = 0; i < vetor.length; i++){
			for(int j = i+1; j < vetor.length; j++){
				if(vetor[i] > vetor[j]){
					aux = vetor[i];
					vetor[i] = vetor[j];
					vetor[j] = aux;
				}
			}	
		}		
		return vetor;
	}

}
